package svc

import (
	"douban/api/internal/config"
	"douban/doubanrpc/doubanrpcclient"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config    config.Config
	DouBanRpc doubanrpcclient.Doubanrpc
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		DouBanRpc: doubanrpcclient.NewDoubanrpc(zrpc.MustNewClient(c.DouBanRpc)),
	}
}
